package cn.edu.gxnu.dsa.sort;

public class DoubleType implements Comparable<DoubleType> {

	private double key;

	public DoubleType(double key) {
		this.setKey(key);
	}

	private void setKey(double key) {
		this.key = key;
	}

	public double getKey() {
		return key;
	}

	@Override
	public int compareTo(DoubleType compareValue) {
		double initValue = this.getKey();
		double compValue = compareValue.getKey();
		return (initValue < compValue ? -1 : (initValue == compValue ? 0 : 1));
	}

	@Override
	public String toString() {
		return this.getKey() + "";
	}

}
